function [Y,f] = ssfft(y,sample_rate)

% 	function [Y,f] = ssfft(y, samplerate)
%   Returns the Single Sided FFT vector of the time-domain input
%   Written by Ed Moore

if nargin == 1
    sample_rate = 8000;
end

nfft = 2^nextpow2(length(y)); % FFT needs powers of two
Y = fft(y,nfft)/length(y);
Y = 2*abs(Y(1:nfft/2+1));
f = sample_rate/2*linspace(0,1,nfft/2+1);